import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: () => import('@/views/layout'),
    children: [
      {
        path: '',
        component: () => import('@/views/home')
      },
      {
        path: '/qa',
        component: () => import('@/views/qa')
      },
      {
        path: '/video',
        component: () => import('@/views/video')
      },
      {
        path: '/profile',
        component: () => import('@/views/profile')
      }

    ]
  },
  { path: '/login', component: () => import('@/views/login') },
  { path: '/search', component: () => import('@/views/search') },
  { path: '/article/:articleId', component: () => import('@/views/article'), props: true },
  { path: '/user', component: () => import('@/views/user'), props: true }
]

const router = new VueRouter({
  routes
})

export default router
